<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Command and Conquer - Tiberian Dawn - HTML5</title>
		<link rel="shortcut icon" href="http://www.adityaravishankar.com/favicon.ico" />
		<link href="http://www.adityaravishankar.com/projects/games/command-and-conquer/" rel="canonical" />
		<meta property='fb:app_id' content='268072089881146' />
		<meta property='og:title' content='Command and Conquer - Tiberian Dawn - HTML5' />
		<meta property='og:url' content='http://www.adityaravishankar.com/projects/games/command-and-conquer/' />
		<meta property='og:image' content='http://www.adityaravishankar.com/projects/games/command-and-conquer/images/logo.jpg' />

		<style type="text/css">
			body {
				background:black;
				color:white;
				text-align:center;	
				font-family: Arial, Helvetica, sans-serif;
				font-size:14px;			
			}
			
			canvas {
				border:1px solid white;	
				cursor:url(images/cursors/blank.gif),none !important;
				background-image: url(images/loading.gif),url(images/htitle.jpeg);
				background-position: center bottom,center;
				background-repeat: no-repeat,no-repeat;
			}
			#debugger {
				border:1px solid white;	
				font-size:12px;
				padding:5px;
				overflow:auto;
				height:400px;		
			}
			
			#specialcontrols{
				display:none;
			}
			
			@font-face {
				font-family:'Command and Conquer';
				src:url('images/sidebar/cnc.ttf');
			}
			
			div {
				border:0px solid red;
			}
			
			#leftcontent {
				float:left;
				width:450px;
				padding:10px;
				text-align:left;	
			}
			
			#rightcontent {
				float:left;
				width:640px;
				padding:10px;
				text-align:left;	
			}
			
			#rightmostcontent {
				text-align: left;
				float:right;
				margin:10px;
				margin-top:0px;
				vertical-align:middle;
				display:none;
			}
			
			H1{
				color:yellow;
				text-align:left;		
			}		
			
			#header {
				padding-bottom:20px;
			}
		</style>		
		
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
		<!--script src="js/jquery.min.js"	 type="text/javascript" charset="utf-8"></script-->
		<script src="js/cnc-v0.3d.js"	 type="text/javascript" charset="utf-8">
		</script>
	</head>
	<body>
	<script type="text/javascript">
	  var _gaq = _gaq || [];
	  _gaq.push(['t1._setAccount', 'UA-9874019-1']);
	  _gaq.push(['t1._trackPageview']);
	  	  (function() {
		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	  })();
	</script>

	
			<div id="leftcontent">
				<img style="float:left;"src="images/logo.jpg" width="400" height="146" alt="Command and Conquer">
				<h1 >C&amp;C - HTML5 v0.3d by <span style="font-size:small;color:white;"><a href="http://www.adityaravishankar.com">Aditya Ravi Shankar</a></span>
				</h1>
				<!--img src="images/cursors/blank.gif"-->
				
				<p>This is a recreation of the original Command and Conquer, Real Time Strategy game entirely in HTML5 and Javascript. </p>	
				<p>This page works best on <a href="http://www.google.com/chrome" title="Google Chrome - Get a fast new browser. For PC, Mac, and Linux">Google Chrome</a> or <a href="http://www.mozilla.org/en-US/firefox/new/" title="Mozilla Firefox Web Browser — Free Download">Mozilla Firefox</a>. The images can take a little while to load so please be patient.</p>
				
				<p style="color:green">This is still a work in progress. Any comments or feedback (including bugs), is appreciated. I intend to develop this game further - improving the AI,  pathfinding (<a href="http://www.adityaravishankar.com/projects/games/pathfinding-javascript-rts-demo/" title="Command and Conquer - RTS Game Pathfinding - HTML5">See improved pathfinding demo here</a>), adding more units and levels. If you are interested in helping out with this effort (even by just testing the game and giving feedback), please let me know. </p>
		<p><u>BUGS and ISSUES:</u><br>Please report bugs on the github issues page or in the comments section below. <a href="https://github.com/adityaravishankar/command-and-conquer/issues">https://github.com/adityaravishankar/command-and-conquer/issues</a></p> 
				
				<p style='color:blue'>If you liked this demo, please let me know by clicking on the Like button below and leaving me a comment. Please share this page with your friends so that they can see it too. </p>
				<p>You can read more about <a href="http://www.adityaravishankar.com/2011/11/command-and-conquer-programming-an-rts-game-in-html5-and-javascript/" title="Command and Conquer - Programming an RTS game in HTML5 and Javascript |">the development of this game</a> on my blog. You can also check out some of the <a href="http://www.adityaravishankar.com/software-projects/games/" title="Games  have written">other games I have written</a> or read some of my <a href="http://www.adityaravishankar.com/category/programming/game-programming/" title="Game Programming Articles">game programming articles</a>.</p>
		My goal is to take this game as far as possible - Add more units, optimize the code, add better AI and multiplayer games. You would be able to come to this page, find a random partner and start playing!!<br> <br>
Several developers have volunteered to help with this effort. I am grateful to everyone who came forward to help. 
<br><br>	If you enjoyed playing this game and would like to support the continued development of the game with donations/contributions, please use the donate button below. Every little bit would help.<br>
				<br>  
				<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
				<input type="hidden" name="cmd" value="_s-xclick">
				<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHiAYJKoZIhvcNAQcEoIIHeTCCB3UCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYC+jndg0TXYHPOB3LUQunes6mwMmdR4Rn2PMLnP03XugvEg9CwaIEaScSDdC2FnwIKzAC8mAl6Nt+StDd2LnzpOEZUO/K06qMmziEtkzbU9GVFq8GVswNsPEZRIHo2MFoupTsDjQrsj32F6zKxgut6ecohqoiHvLaxMdG6SoiSh0TELMAkGBSsOAwIaBQAwggEEBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECJ4APR18jJ4lgIHgJUCV7kVfJZTPZ06q39K3OwiLrFD59zVBxHGZXSFAmhvQyzfQZvHk4iQkw72CFZp4gRgbtmwQbn7Cd2NAKuTD2HMU4dGetfSuc1JaP6v4cr6Zab9PVn7WmYnmli3Lc2IZKlzsz2NUyV0hJDzctFG8a6+OWddR3vPC+t64bOdMqOVO84HR0yS+7Iu5tQKG8WUhfqXZdlXvdkpB0GJSYQDP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vbYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAIFfOlaagFrl71+jq6OKidbWFSE+Q4FqROvdgIONth+8kSK//Y/4ihuE4Ymvzn5ceE3S/iBSQQMjyvb+s2TWbQYDwcp129OPIbD9epdr4tJOUNiSojw7BHwYRiPh58S1xGlFgHFXwrEBb3dgNbMUa+u4qectsMAXpVHnD9wIyfmHMYIBmjCCAZYCAQEwgZQwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xMjAxMjExMDQ0MTJaMCMGCSqGSIb3DQEJBDEWBBQ4y/2zRvqG920d6RzjRJBQOff/gjANBgkqhkiG9w0BAQEFAASBgGD/DOJHt0IJ+iCdPR44tDdW71K60qeVzC2d6ss8BjWgf9pR0RI4b/yXCe5O6WyIiDA//jHuznwTZPtchnZZDeA5MsXsIfDF5Pfo8PalSVZIeCeFKm/L7z3nK55Ownp2UinSvP6sC4hSLsaWc0zU0EyQxteSXtxla7d+ahSBRLkg-----END PKCS7-----
				">
				<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
				<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
				</form>
				<br>
				NOTE: Donations help me pay for hosting (which I currently pay for out of my own pocket). While welcome and appreciated, donations are not necessary to play this game. <br><br>This game will always be free for everyone to enjoy. 
				
				<br><br>
				<div id="socialbadges" style="margin-bottom:10px;text-align:right;">
					<div id="fb-root"></div>
					<script>(function(d, s, id) {
					  var js, fjs = d.getElementsByTagName(s)[0];
					  if (d.getElementById(id)) {return;}
					  js = d.createElement(s); js.id = id;js.async=true;
					  js.src = "http://connect.facebook.net/en_US/all.js#xfbml=1";
					  fjs.parentNode.insertBefore(js, fjs);
					}(document, 'script', 'facebook-jssdk'));</script>			
					<div class="fb-like" data-href="www.adityaravishankar.com/projects/games/command-and-conquer/" data-send="true" data-width="440" data-show-faces="true" data-font="arial"></div>
					<br>
					
					<div class="fb-like" data-send="false" data-href="www.adityaravishankar.com/projects/games/command-and-conquer/" data-layout="box_count"  data-show-faces="false"></div>
					&nbsp;
					<!-- Place this tag in your head or just before your close body tag -->
					<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>

					<!-- Place this tag where you want the +1 button to render -->
					<div class="g-plusone" data-size="tall" data-href="http://www.adityaravishankar.com/projects/games/command-and-conquer/"></div>
					&nbsp;
					<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.adityaravishankar.com/projects/games/command-and-conquer/" data-via="adityarshankar" data-count="vertical">Tweet</a>
					<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
					
				</div>
				
						
				
				<div class="fb-comments" data-href="www.adityaravishankar.com/projects/games/command-and-conquer/" data-num-posts="5"   data-colorscheme="dark" data-width="450"></div>
			</div>
			<div id="rightcontent">
			<canvas id="canvas" width="640" height="535">
				Your browser does not support the HTML5 Canvas feature. This game uses new HTML5 features and will only work on the latest versions of Firefox, Safari or Chrome (and maybe Internet Explorer 9).			
			</canvas>
		
			<div id='specialcontrols'>
				<label for="debug_mode">Debug Mode: </label><input type="checkbox" name="debug_mode" id="debug_mode">
			</div>
			<div id = "featuresdiv">
				<p style="clear:all;float:right;margin-left:10px;margin-top:10px;"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" id="Player_b03de607-447c-483c-a742-4c4c26c1b975"  WIDTH="250px" HEIGHT="250px"> <PARAM NAME="movie" VALUE="http://ws.amazon.com/widgets/q?rt=tf_ssw&ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fwwwadityaravi-20%2F8003%2Fb03de607-447c-483c-a742-4c4c26c1b975&Operation=GetDisplayTemplate"><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE="#FFFFFF"><PARAM NAME="allowscriptaccess" VALUE="always"><embed src="http://ws.amazon.com/widgets/q?rt=tf_ssw&ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fwwwadityaravi-20%2F8003%2Fb03de607-447c-483c-a742-4c4c26c1b975&Operation=GetDisplayTemplate" id="Player_b03de607-447c-483c-a742-4c4c26c1b975" quality="high" bgcolor="#ffffff" name="Player_b03de607-447c-483c-a742-4c4c26c1b975" allowscriptaccess="always"  type="application/x-shockwave-flash" align="middle" height="250px" width="250px"></embed></OBJECT> <NOSCRIPT><A HREF="http://ws.amazon.com/widgets/q?rt=tf_ssw&ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fwwwadityaravi-20%2F8003%2Fb03de607-447c-483c-a742-4c4c26c1b975&Operation=NoScript">Amazon.com Widgets</A></NOSCRIPT></p>
					<div id="debugger">
						Debugging off. 
					</div>
				<br>
				<p style="font-size:smaller;">Updates:
					<ul style="font-size:smaller;">
						<li>v0.3d Released
							<ul>
							<li>Harvester saved when refinery is sold</li>	
							<li>Ctrl + 0-9 can be used to set unit control groups</li>
							<li>No building on fog of war or half outside screen</li>
							<li>Canceling returns money</li>
							<li>Can start building with insufficient funds. Waits when out of money</li>
							
							</ul>
						</li>	
						<br>
						<li>v0.3c Released - Performance patch
							<ul>
							<li>Harvesters collect 700 per trip</li>	
							<li>Using sprite sheets for faster loading and processing.</li>
							</ul>
						</li>	
						<br>
						<li>Special thanks to <a href="http://www.nahklick.de/">http://www.nahklick.de/</a> for hosting during periods of high traffic. <br><br>Please continue to bookmark &amp; share <a href="http://www.adityaravishankar.com/projects/games/command-and-conquer/">http://www.adityaravishankar.com/projects/games/command-and-conquer/</a> instead of the temporary redirect page.
						</li><br>
						<li>v0.3b Released - Bugfixes - Thank you for all your feedback!!
							<ul>
							<li>Tanks can turn in place</li>	
							<li>Tooltip shows unit/building cost</li>
							<li>Harvester life does not regenerate inside refinery</li>
							<li>Can pan to the right edge of the map even with sidebar visible</li>
							</ul>
						</li>	
						<br>
						<li>v0.3 Released
							<ul>
							<li>Can repair or sell buildings</li>	
							<li>Refinery and Harvesters to process tiberium (cash)</li>
							<li>Lots of bug fixes and Speed/Performance optimization</li>
							</ul>
						</li>	
						<br>
						<li>v0.2 Released
							<ul>
							<li>Improved pathfinding</li>
							</ul>
						</li>
						<br>
						<li>v0.1 Released</li>
					</ul>
				</p>
				<p style="font-size:smaller;margin-top:10px;">Controls:
					<ul style="font-size:smaller;">
						<li>Unit Selection 
							<ul>
							<li>Single Unit - Click on a unit to select it</li>	
							<li>Drag Selection - Drag mouse to select multiple units</li>
							<li>Multiple Selection - Shift + Click to add unit  multiple units</li>
							</ul>
						</li>	
						<li>Movement/Attacking
							<ul>
							<li>Move - Select unit(s) and click on destination to move</li>
							<li>Attack - Select unit(s) and click on target building or unit to attack</li>
							<li>Map panning - Move cursor near edge of map to pan and scroll around</li>
							</ul>
						</li>
						<li>Building
							<ul>
							<li>Build Construction Yard - Move MCV to where you want, and click on it to deploy</li>
							<li>Expand Sidebar and click on construction options to build them. Once you finish contruction, more options become available</li>
							</ul>
						</li>
						
					</ul>
				</p>
				
							<p style="font-size:smaller;">DISCLAIMER: This project is only intended as a technical proof of concept to demonstrate the basic working elements of an RTS game in HTML5. No commercial use is intended. All images and sounds used are from C&amp;C - Tiberian Dawn and are property of the original game creators. </p>

			</div>
	
		</div>
		
			<div style="float:left;margin-left:20px;padding:20px;">
				<div style="">
				<script type="text/javascript">
				google_ad_client = "ca-pub-4565102206556382";
				/* SmallSquare1 */
				google_ad_slot = "9663428057";
				google_ad_width = 200;
				google_ad_height = 200;

				</script>
				
				<script type="text/javascript"
				src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
				</script>	
				</div>
				<div style="padding:20px;">
				<script type="text/javascript">
				google_ad_client = "ca-pub-4565102206556382";
				/* Small Square 2 */
				google_ad_slot = "3705220259";
				google_ad_width = 200;
				google_ad_height = 200;
				
				</script>
				<script type="text/javascript"
				src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
				</script>
				</div>
				<div>
					<script type="text/javascript">
					google_ad_client = "ca-pub-4565102206556382";
					/* Skyscraper */
					google_ad_slot = "9356447655";
					google_ad_width = 160;
					google_ad_height = 600;
				
					</script>
					<script type="text/javascript"
					src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
					</script>
				</div>
			</div>
	
		
	</body>
</html>
